<template>
  <div>
    <p>count:{{ count }}</p>
    <hr />
    <Child @addCount="addCount" />
  </div>
</template>
<script>
import Child from './components/Child.vue';
export default {
  name: 'App',
  components: {
    Child,
  },
  data() {
    return {
      count: 0,
    };
  },
  methods: {
    // 自定义事件函数的参数就是  在组件内部$emit调用自定义事件的时候传递的参数
    addCount(a, b, c) {
      console.log('addCount触发', a, b, c);
      this.count += c;
    },
  },
};
</script>
<style></style>
